<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<link href="__THEMES__/style/login.css" rel="stylesheet" />
		<script type="text/javascript" src="__JS__/jQuery/jquery.js"></script>
		<script type="text/javascript" src="__JS__/jQuery/plugin/alertbox.js"></script>
		<script type="text/javascript">
			$(function(){
				$('input[name="account"]').focus();
				$('form').submit(function() {
					if ( $.trim($('#username').val()) == '' ){
						$('#username').css({
							"background-position" : "0px -86px"
						});
						setAlertBox('用户名不能为空！', 1);
						$('#username').focus();
						return false;
					}
					if ( $.trim($('#password').val()) == '' ){
						$('#password').css({
							"background-position" : "0px -129px"
						});
						setAlertBox('密码不能为空！', 1);
						$('#password').focus();
						return false;
					}
					$.ajax({
						url : "{:U('public/checklogin')}",
						cache : false,
						type : 'POST',
						dataType : 'json',
						data : 'account='+$('#username').val()+'&password='+$('#password').val(),
						success : function(e){
							if ( e.status == 0 ){
								setAlertBox( e.info, 1 );
							}else{
								window.location.href = '__APP__';
							}
						}
					});
					return false;
				});
				
				$('.login_input').keypress(function(){
		        	if ( $.trim( $(this).val() ) != '' ){
		        		$(this).removeAttr('style');
		        	}
		        });
				
			});
			
			function fleshVerify(type){ 
				//重载验证码
				var timenow = new Date().getTime();
				if (type){
					$('#verifyImg').attr("src", '__URL__/verify/adv/1/'+timenow);
				}else{
					$('#verifyImg').attr("src", '__URL__/verify/'+timenow);
				}
			}
		</script>
	</head>
	<body>
		<div id="login">
			<h2 class="logo"></h2>
			<div class="box">
				<table cellpadding="0" cellspacing="0" border="0">
					<tr>
						<td class="top_left"></td>
						<td class="top_center"></td>
						<td class="top_right"></td>
					</tr>
					<tr>
						<td class="b_left"></td>
						<td class="b_content">
							<h3 class="title">Welcome Login XXXX Manage Center Board...</h3>
							<div class="c_content">
								<form action="#" method="post">
								<ul>
									<li><input type="text" name="account" id="username" class="login_input" /></li>
									<li><input type="password" name="password" id="password" class="login_input" /></li>
									<!--li><input name="verify" type="text" size="5" class="login_input" style="float:left;" /><span class="pic"><img id="verifyImg" SRC="{:U('verify')}" onClick="fleshVerify()" border="0" alt="点击刷新验证码" style="cursor:pointer" align="absmiddle"></span></li-->
									<li><input type="submit" value="Login" class="login_submit" /><input type="button" class="login_submit" style="margin-left:15px;" value="Back to Home Page" /></li>
									<br />
									<br />
								</ul>
								</form>
							</div>
						</td>
						<td class="b_right"></td>
					</tr>
					<tr>
						<td class="bo_left"></td>
						<td class="bo_center"></td>
						<td class="bo_right"></td>
					</tr>
				</table>
				<div id="top_left" class="f_box"></div>
				<div id="top_right" class="f_box"></div>
				<div id="bo_left" class="f_box"></div>
				<div id="bo_right" class="f_box"></div>
			</div>
		</div>
	</body>
</html>